package cn.zhentao.charge.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.zhentao.charge.mapper.ChargeStationCommentMapper;
import cn.zhentao.charge.domain.ChargeStationComment;
import cn.zhentao.charge.service.IChargeStationCommentService;

/**
 * 充电站评论Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-16
 */
@Service
public class ChargeStationCommentServiceImpl implements IChargeStationCommentService 
{
    @Autowired
    private ChargeStationCommentMapper chargeStationCommentMapper;

    /**
     * 查询充电站评论
     * 
     * @param id 充电站评论主键
     * @return 充电站评论
     */
    @Override
    public ChargeStationComment selectChargeStationCommentById(Long id)
    {
        return chargeStationCommentMapper.selectChargeStationCommentById(id);
    }

    /**
     * 查询充电站评论列表
     * 
     * @param chargeStationComment 充电站评论
     * @return 充电站评论
     */
    @Override
    public List<ChargeStationComment> selectChargeStationCommentList(ChargeStationComment chargeStationComment)
    {
        return chargeStationCommentMapper.selectChargeStationCommentList(chargeStationComment);
    }

    /**
     * 新增充电站评论
     * 
     * @param chargeStationComment 充电站评论
     * @return 结果
     */
    @Override
    public int insertChargeStationComment(ChargeStationComment chargeStationComment)
    {
        chargeStationComment.setCreateTime(DateUtils.getNowDate());
        return chargeStationCommentMapper.insertChargeStationComment(chargeStationComment);
    }

    /**
     * 修改充电站评论
     * 
     * @param chargeStationComment 充电站评论
     * @return 结果
     */
    @Override
    public int updateChargeStationComment(ChargeStationComment chargeStationComment)
    {
        return chargeStationCommentMapper.updateChargeStationComment(chargeStationComment);
    }

    /**
     * 批量删除充电站评论
     * 
     * @param ids 需要删除的充电站评论主键
     * @return 结果
     */
    @Override
    public int deleteChargeStationCommentByIds(Long[] ids)
    {
        return chargeStationCommentMapper.deleteChargeStationCommentByIds(ids);
    }

    /**
     * 删除充电站评论信息
     * 
     * @param id 充电站评论主键
     * @return 结果
     */
    @Override
    public int deleteChargeStationCommentById(Long id)
    {
        return chargeStationCommentMapper.deleteChargeStationCommentById(id);
    }
}
